<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" 
      xmlns:sec="http://www.pollix.at/thymeleaf/shiro">
<head>
	<title >残疾人之家信息系统</title>
	<!-- 这儿引用单独的css link -->
	<link th:href="@{/static/media/base.css}" rel="stylesheet"/>
	<style type="text/css"></style>
</head>

<body>
    <div class="main" >
        <div class="con_title">
            <h1   th:text=${title}></h1>
            <div class="content-inf" >
                <p>发布时间：
                <span id="datetime" ></span>&nbsp; &nbsp; &nbsp; &nbsp;所属机构： 
                <!--  <th:block th:each="obj:${organ_dict}" th:if="${AnnounceOrg.organId eq obj.id}" ><span   th:text="${obj.tName}" ></span></th:block>
                &nbsp; &nbsp; &nbsp; &nbsp;活动类型：机构公告</p> -->
                <span id="organName" >1111</span>
                &nbsp; &nbsp; &nbsp; &nbsp;活动类型：<span th:text=${type}></span></p>
            </div>
        </div>
        <div class="content">
            <div class="box">
                <div class="content-txt">
                    <p style="text-align: center;" ></p>
                    <p>
                     	<div class="layui-upload-list" align="center" id="preImages"></div>
                    </p>
                </div>
            </div>          
        </div>
    </div>
    <!-- 通用js -->
	<div th:include="admin/common/html/js :: onload_js"></div>
	<script type="text/javascript">
		 
		$(function() {
			var title = '[[${title}]]';
			var type = '[[${type}]]';
			
			getMedia(title,type)
		})
	
		
		function getMedia(title,type){
			$.ajax({
				type: 'POST',
				url: '/lame/admin/preview/detail',
				data: {
					title:title,
					type:type
				},
				dataType: 'json',
				success: function (data) {
					var outAttachId = data.data.outAttachId;
					if(outAttachId.indexOf(",")!=-1){
						outAttachId.split(",").forEach(function(value , index , array){ 
							$('#preImages').append('<img style="width:100%;height:100%" src="/lame/FileController/viewImg/'+value+'"><br><br>')
						})
					}else{
						$('#preImages').append('<img style="width:100%;height:100%" src="/lame/FileController/viewImg/'+outAttachId+'"><br><br>')
					}
					
					$('#organName').html(data.data.organName);
					$('#datetime').html(data.data.datetime);
				}
			});
        }
	</script>
</body>
</html>